package com.xbai.item.controller;

import com.xbai.entity.Result;
import com.xbai.entity.StatusCode;
import com.xbai.item.service.PageService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author jxbai
 * @desc
 * @date 2021/2/3 0003
 */
@RestController
@RequestMapping("/page")
@RequiredArgsConstructor
public class PageController {

    private final PageService pageService;

    /**
     * 生成静态页面
     * @param id
     * @return
     */
    @RequestMapping("/createHtml/{id}")
    public Result createHtml(@PathVariable("id") Long id) {
        pageService.createPageHtml(id);
        return new Result(true,StatusCode.OK,"ok");
    }
}
